package cn.evolify.jfinaldemo.controller;

import cn.evolify.jfinaldemo.service.IUserService;
import cn.evolify.jfinaldemo.service.impl.UserService;
import com.jfinal.core.Controller;

/**
 * Created by wolf on 2017/2/21.
 **/
public class UserController extends Controller {

    private IUserService userService=new UserService(this);

    public void index(){
        render("login.html");
    }

    public void doLogin(){
        String userName=getPara("userName");
        String password=getPara("password");
        if (userService.login(userName,password)){
            renderJson("status",true);
        }else{
            renderJson("status",false);
        }
    }
}
